package com.itheima.tlias.controller;

import com.itheima.tlias.common.result.Result;
import com.itheima.tlias.mapper.DeptMapper;
import com.itheima.tlias.mapper.EmpMapper;
import com.itheima.tlias.mapper.StudentMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
//@AllArgsConstructor
public class TestAutowiredController {

    EmpMapper empMapper;

    DeptMapper deptMapper;

    StudentMapper studentMapper;

    /*@Autowired
    public TestAutowiredController(DeptMapper deptMapper, EmpMapper empMapper, StudentMapper studentMapper) {
        this.deptMapper = deptMapper;
        this.empMapper = empMapper;
        this.studentMapper = studentMapper;
    }*/
    @GetMapping("/testCons")
    public Result getBeans(){
//        Emp emp = empMapper.SelectEmpByUsername("库里");
//        int flag = deptMapper.batchDeleteDept();
//        studentMapper.updateStudent();
        log.info("emp={}",empMapper.selectEmpByUsername("admin"));
        return Result.success();
    }
}
